
import org.codehaus.xfire.*;
import org.codehaus.xfire.service.*;
import org.codehaus.xfire.service.binding.*;
import org.codehaus.xfire.client.*;

import java.net.*;

public class HelloWorldClient {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Service srvcModel = new ObjectServiceFactory().create(IHelloWorldService.class);
        XFireProxyFactory factory =new XFireProxyFactory(XFireFactory.newInstance().getXFire());
        String url = "http://localhost:8080/HelloWorld/services/HelloWorldService";
    try {
           IHelloWorldService srvc = (IHelloWorldService)factory.create(srvcModel, url);
           String result = srvc.example("hello world");
           System.out.print(result);
        } catch (MalformedURLException e){
           e.printStackTrace();
        }


    }

}
